A bunch of busy work to satisfy hyperactive warnings in newer GCC builds.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 8 Jul 2015 17:50:18 +0000 (17:50 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 8 Jul 2015 17:50:18 +0000 (17:50 +0000)
14 files changed:
gpsbabel/an1.cc
gpsbabel/dg-100.cc
gpsbabel/dmtlog.cc
gpsbabel/garmin_xt.cc
gpsbabel/jeeps/gpsapp.cc
gpsbabel/jeeps/gpsusbcommon.cc
gpsbabel/lowranceusr4.cc
gpsbabel/mapsend.cc
gpsbabel/mmo.cc
gpsbabel/nmea.cc
gpsbabel/psitrex.cc
gpsbabel/saroute.cc
gpsbabel/vitosmt.cc
gpsbabel/vitovtt.cc

index 9edd025d02721d75ea12fa16726ed3e522412618..b261c82ffd4eb77aa51be486fd824e165553a54e 100644 (file)
@@ -639,6 +639,7 @@ static void Read_AN1_Header(gbfile* f)
   unsigned short type;
 
   magic = ReadShort(f);
+  (void) magic; // hush warning.
   type = ReadShort(f);
 
   last_read_type = type;
index e612e0cc7d38a5a284f4d89abd51085daf4abffd..9f519a5edc5e95513a2d4dd63b7801252c69e19f 100644 (file)
@@ -509,6 +509,8 @@ dg100_recv_frame(struct dg100_command** cmdinfo_result, uint8_t** payload)
   }
   payload_checksum  = be_read16(buf + frame_len - 4);
   frame_end_seq     = be_read16(buf + frame_len - 2);
+  (void) payload_end_seq;
+  (void) frame_end_seq;
 
   dg100_log("RX: Start %04x Len %04x Cmd: %s\n",
             frame_start_seq, payload_len_field, cmdinfo->text);
index bccea5aa8ee96bca50e4880031a9e0eb0fab750f..00d3de903871426926523bf28a34c24708e511ac 100644 (file)
@@ -433,6 +433,7 @@ read_CTrackFile(const int version)
   ux = gbfgetint32(fin); // Unknown 2
   ux = gbfgetint32(fin); // Unknown 3
   ux = gbfgetint32(fin); // Unknown 4
+  (void) ux; // Silence warning.
 
   track = route_head_alloc();
   track_add_head(track);
index 037708618a6c01a49a100cee228a6f7a164c0221..6d98d59b956a3c457c4ec20a075d051ca0662db8 100644 (file)
@@ -107,6 +107,7 @@ format_garmin_xt_rd_st_attrs(char* p_trk_name, uint8_t* p_track_color)
 
   trackbytes = gbfgetuint16(fin);
   TrackPoints = gbfgetuint16(fin);
+  (void) TrackPoints;
 
   switch (method) {
   case 1:
@@ -239,7 +240,7 @@ format_garmin_xt_proc_strk(void)
   uint8_t      ii; // temp variable
   double               Lat = 0, Lon = 0; // wpt data
   double               PrevLat = 0, PrevLon = 0, PrevEle = 0; // wpt data
-  uint32_t     Time = 0, PrevTime =0; // wpt data
+  uint32_t     Time = 0; // wpt data
   int          FirstCoo;
   uint8_t      trk_color = 0xff;
 
@@ -308,7 +309,6 @@ format_garmin_xt_proc_strk(void)
         }
         PrevLat = Lat;
         PrevLon = Lon;
-        PrevTime = Time;
       }
     }
 
index a3a98d6addce9d5d4db37dd4db9a49c07bcada40..421bd406270dde4145d2dec2426dbb1542d7f395 100644 (file)
@@ -4484,11 +4484,8 @@ void GPS_D310_Get(GPS_PTrack* trk, UC* s)
 ************************************************************************/
 void GPS_D311_Get(GPS_PTrack* trk, UC* s)
 {
-  UC* p;
   short identifier;
 
-  p=s;
-
   /* Forerunner */
   identifier = GPS_Util_Get_Short(s);
   sprintf((*trk)->trk_ident, "%d", identifier);
index d16eefd82f73da70629f79741302e668b42cc743..14b7a0ac859e07db84ad93d5b08c91e030a300ca 100644 (file)
@@ -83,10 +83,8 @@ gusb_cmd_get(garmin_usb_packet* ibuf, size_t sz)
 {
   int rv;
   unsigned char* buf = (unsigned char*) &ibuf->dbuf;
-  int orig_receive_state;
   unsigned short pkt_id;
 top:
-  orig_receive_state = receive_state;
   switch (receive_state) {
   case rs_fromintr:
     rv = gusb_llops->llop_get_intr(ibuf, sz);
index a0a5c644a3a0bbeb2d0005aada72fc7a744a36c0..561b7d481c9a900b8b5a538dc5bb35fbe499f8ba 100644 (file)
@@ -419,6 +419,7 @@ lowranceusr4_parse_waypoints(void)
        used in usr4 match those from usr{2,3} so we need a new
        mapping. */
     icon_num = gbfgetint16(file_in);
+    (void) icon_num; // Hush warning for now.
     /* wpt_tmp->icon_descr = lowranceusr_find_desc_from_icon_number(icon_num); */
 
     /* Color ID, discard for now */
@@ -759,8 +760,11 @@ data_read(void)
 
   /* for now we won't use these for anything */
   create_date = gbfgetint32(file_in);
+  (void) create_date;
   create_time = gbfgetint32(file_in);
+  (void) create_time;
   byte = gbfgetc(file_in); /* unused, apparently */
+  (void) byte;
 
   serial_num = gbfgetint32(file_in);
   if (global_opts.debug_level >= 1) {
index a887c99d56212183ce573dc4f5851f7d60a10714..b0caad99a20eb6033048bf64be0580aed25f30ee 100644 (file)
@@ -126,8 +126,10 @@ mapsend_wpt_read(void)
     wpt_tmp->description = gbfgetpstr(mapsend_file_in);
 
     wpt_number = gbfgetint32(mapsend_file_in);
+    (void) wpt_number; // hush warning.
     wpt_icon = gbfgetc(mapsend_file_in);
     wpt_status = gbfgetc(mapsend_file_in);
+    (void) wpt_status; // hush warning.
 
     wpt_tmp->altitude = gbfgetdbl(mapsend_file_in);
     wpt_tmp->longitude = gbfgetdbl(mapsend_file_in);
index f2d071f049585d433f07754f770411ee731d5944..ee7a53bf1658a7f941ae6fe5e4d9e44866a4101f 100644 (file)
@@ -399,6 +399,7 @@ mmo_read_CObjIcons(mmo_data_t* data)
     DBG((sobj, "unknown value = 0x%04X (since 0x18)\n", u16));
   }
   u16 = gbfgetuint16(fin);
+  (void) u16;
   DBG((sobj, "unknown value = 0x%04X\n", u16));
   u16 = gbfgetuint16(fin);
   DBG((sobj, "unknown value = 0x%04X\n", u16));
@@ -459,6 +460,7 @@ mmo_read_CObjWaypoint(mmo_data_t* data)
     DBG((sobj, "unknown value = 0x%04X (since 0x18)\n", u16));
     u16 = gbfgetuint16(fin);
     DBG((sobj, "unknown value = 0x%04X (since 0x18)\n", u16));
+    (void) u16;
   }
 
   wpt->latitude = gbfgetdbl(fin);
@@ -542,6 +544,7 @@ mmo_read_CObjWaypoint(mmo_data_t* data)
 
   ux = gbfgetuint32(fin);
   DBG((sobj, "proximity type = %d\n", ux));
+  (void) ux;
 
   data->loaded = 1;
 
@@ -582,10 +585,12 @@ mmo_read_CObjRoute(mmo_data_t* data)
     DBG((sobj, "unknown value = 0x%04X (since 0x18)\n", u16));
     u16 = gbfgetuint16(fin);
     DBG((sobj, "unknown value = 0x%04X (since 0x18)\n", u16));
+    (void) u16;
   }
 
   ux = gbfgetc(fin);           /* line label */
   DBG((sobj, "line label = %d\n", ux));
+  (void) ux;
 
   data->left = rtept = gbfgetint16(fin);
   DBG((sobj, "route has %d point(s)\n", rtept));
@@ -657,6 +662,7 @@ mmo_read_CObjTrack(mmo_data_t* data)
     DBG((sobj, "unknown value = 0x%04X (since 0x18)\n", u16));
     u16 = gbfgetuint16(fin);
     DBG((sobj, "unknown value = 0x%04X (since 0x18)\n", u16));
+    (void) u16;
   }
 
   tp = gbfgetint16(fin);
@@ -681,10 +687,12 @@ mmo_read_CObjTrack(mmo_data_t* data)
       uint16_t ux;
       ux = gbfgetuint16(fin);
       DBG((sobj, "unknown value = 0x%04X (%d)\n", ux, ux));
+      (void) ux;
       if (unk > 1) {
         uint16_t ux;
         ux = gbfgetuint16(fin);
         DBG((sobj, "unknown value = 0x%04X (%d)\n", ux, ux));
+        (void) ux;
       }
     }
     track_add_wpt(trk, wpt);
@@ -710,6 +718,7 @@ mmo_read_CObjTrack(mmo_data_t* data)
     trk->line_color.bbggrr = gbfgetuint32(fin);        /* rgb color */
     trk->line_color.opacity = 255;
     DBG((sobj, "color = 0x%06X\n", trk->line_color.bbggrr));
+    (void) u32;
   }
 
   if (mmo_version >= 0x12) {
@@ -735,6 +744,7 @@ mmo_read_CObjTrack(mmo_data_t* data)
       DBG((sobj, "unknown value = 0x%04X (since 0x16)\n", u16));
       u16 = gbfgetuint16(fin);
       DBG((sobj, "unknown value = 0x%04X (since 0x16)\n", u16));
+      (void) u16;
     }
   }
 
@@ -762,6 +772,8 @@ mmo_read_CObjText(mmo_data_t* data)
   lat = gbfgetdbl(fin);
   lon = gbfgetdbl(fin);
   DBG((sobj, "coordinates = %f / %f\n", lat, lon));
+  (void) lat;
+  (void) lon;
 
   text = mmo_readstr();
   DBG((sobj, "text = \"%s\"\n", text));
@@ -793,6 +805,8 @@ mmo_read_CObjCurrentPosition(mmo_data_t* data)
   lat = gbfgetdbl(fin);
   lon = gbfgetdbl(fin);
   DBG((sobj, "coordinates = %f / %f\n", lat, lon));
+  (void) lat;
+  (void) lon;
 
   mmo_fillbuf(buf, 24, 1);
   if (mmo_version >= 0x18) {
@@ -881,6 +895,7 @@ mmo_read_object(void)
       data->visible = gbfgetc(fin);
 
       obj_type = gbfgetuint32(fin);
+      (void) obj_type;
 #ifdef MMO_DBG
       uint32_t expected_type = 0xFFFFFFFF;
       if (objid == ico_object_id) {
index 525300f45ec07afed12a6a81c6962a59b3974616..6b221a3138e2a610487f4587fb0134a37b78e791 100644 (file)
@@ -674,7 +674,7 @@ gpgsa_parse(char* ibuf)
 {
   char fixauto;
   char fix;
-  int  prn[12];
+  int  prn[12] = {0};
   int  scn,cnt;
   float pdop=0,hdop=0,vdop=0;
   char*        tok=0;
@@ -685,7 +685,9 @@ gpgsa_parse(char* ibuf)
                &fixauto, &fix,
                &prn[0],&prn[1],&prn[2],&prn[3],&prn[4],&prn[5],
                &prn[6],&prn[7],&prn[8],&prn[9],&prn[10],&prn[11]);
-
+  if (scn < 4) {
+    warning(MYNAME ": Short GSA sentence.");
+  }
   /*
        sscanf has scanned all the leftmost elements
        we'll rescan by skipping 15 commas to the dops
index 8f2dc0b3516afee27474a688570e38cf9ef36c57..9f0dd9ca55249b77b727d8708b5af503607086ae 100644 (file)
@@ -390,14 +390,9 @@ static void
 psit_route_r(gbfile* psit_file, route_head** rte)
 {
   char rtename[256];
-  unsigned int rte_num;
-
-  int          garmin_icon_num;
-
+  int garmin_icon_num;
   route_head* rte_head;
-  unsigned int rte_count;
-
-  Waypoint*    thisWaypoint;
+  Waypoint* thisWaypoint;
 
   psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL);
 
@@ -414,10 +409,6 @@ psit_route_r(gbfile* psit_file, route_head** rte)
   route_add_head(rte_head);
   *rte = rte_head;
 
-  rte_num = 0;
-
-  rte_count = 0;
-
   psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), wscomma);
 
   while (psit_isKnownToken(psit_current_token) != 0) {
@@ -470,17 +461,14 @@ static void
 psit_routehdr_w(gbfile* psit_file, const route_head* rte)
 {
   unsigned int rte_datapoints;
-  QString      rname;
-
-  Waypoint*    testwpt;
-  time_t               uniqueValue = 0;
-  int                  allWptNameLengths;
+  QString rname;
 
+  Waypoint* testwpt;
+  time_t uniqueValue = 0;
   queue* elem, *tmp;
 
   /* total nodes (waypoints) this route */
   rte_datapoints = 0;
-  allWptNameLengths = 0;
 
   if (rte->waypoint_list.next) {               /* this test doesn't do what I want i.e test if this is a valid route - treat as a placeholder for now */
 
@@ -527,11 +515,9 @@ psit_track_r(gbfile* psit_file, route_head** trk)
   unsigned int trk_num;
 
   struct tm tmTime;
-  time_t       dateTime = 0;
+  time_t dateTime = 0;
   route_head* track_head = NULL;
-  unsigned int trk_count;
-
-  Waypoint*    thisWaypoint;
+  Waypoint* thisWaypoint;
 
   psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL);
   if (strlen(psit_current_token) == 0) {
@@ -543,9 +529,6 @@ psit_track_r(gbfile* psit_file, route_head** trk)
   rtrim(trkname);
 
   trk_num = 0;
-
-  trk_count = 0;
-
   track_head = NULL;
 
   psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), wscomma);
index 8c0ce54dc69469a94735499d28cc04ef0575887b..4557e77750194e8b80b98372ca1efbeb11436dda 100644 (file)
@@ -224,7 +224,10 @@ my_read(void)
 
         addrlen = le_read16(&record[obase]);
         cmtlen = le_read16(&record[obase+2+addrlen]);
+        (void) cmtlen;
 #if NEW_STRINGS
+        // That we've had no bugreports on this strongly indicates this code
+        // is never used... 
         wpt_tmp->shortname = "booger";
         wpt_tmp->notes = "goober";
 #else
index 41f0d9d27b405a859659d1e63b1c6912b812d289..6d1471360385849e15bb58195ee13f1945249097 100644 (file)
@@ -99,6 +99,7 @@ vitosmt_read(void)
   count                = gbfgetint32(infile);  /* n    */
   check1               = gbfgetint32(infile);  /* 0    */
   check2               = gbfgetint32(infile);  /* not sure */
+  (void) check2; // silence warning.
   check3               = gbfgetint32(infile);  /* n    */
 
   if (version!=vitosmt_version) {
index 124742af2949c523bf8bf7d16f120155c065c413..4101ea1e978021e71044d5c6ca39b6464879f43a 100644 (file)
@@ -111,6 +111,9 @@ vitovtt_read(void)
     /*
      * TODO: interpret speed, course, status
      */
+    (void) speed;
+    (void) course;
+    (void) status;
 
     track_add_wpt(route_head, wpt_tmp);